package common;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.PriorityBlockingQueue;

import entity.Card;

/**
 * 描述：
 * @author：<a href="mailto:beier.zheng@yeepay.com">郑贝尔</a>
 * @since：Nov 20, 2012 6:33:45 PM
 * @version:1.0
 */
public class Test {
	public static  BlockingQueue<Card> cardq=new PriorityBlockingQueue<Card>(200);
	public static void main(String[] args) throws InterruptedException {
		for(int i = 1;i<11;i++){
			Card card = new Card();
			card.setId(i);
			card.setName("name"+i);
			cardq.put(card);
		}
		System.out.println(cardq.size());
		for(int j=1;j<20;j++){
			if(cardq.size()>0){
			Card card = cardq.poll();
			System.out.println(j+"  remain:"+card.getId());
			}
		}
		
	}
	
}
